using Microsoft.CodeAnalysis;

namespace UnmanagedClass.Generator
{
    /// <summary>
    /// 诊断描述符集合
    /// </summary>
    internal static class Diag
    {
        /// <summary>UC0001：Inherit 指定的基类型不是 struct。</summary>
        public static readonly DiagnosticDescriptor BaseNotStruct = new DiagnosticDescriptor(
            id: "UC0001",
            title: "[Inherit] 的基类型必须是 struct",
            messageFormat: "类型 '{0}' 的 [Inherit] 参数 '{1}' 不是结构体 (struct)。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);

        /// <summary>UC0002：基结构体必须为非托管类型。</summary>
        public static readonly DiagnosticDescriptor BaseNotUnmanaged = new DiagnosticDescriptor(
            id: "UC0002",
            title: "基结构体必须为非托管 (unmanaged)",
            messageFormat: "基结构体 '{0}' 必须为非托管类型（仅包含非托管字段）。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);

        /// <summary>UC0003：模板类型必须是 struct 且为 unmanaged。</summary>
        public static readonly DiagnosticDescriptor TargetNotStructOrUnmanaged = new DiagnosticDescriptor(
            id: "UC0003",
            title: "[Inherit] 只能用于非托管结构体",
            messageFormat: "类型 '{0}' 必须是结构体 (struct) 且为非托管 (unmanaged) 类型。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);

        /// <summary>UC0004：将要生成的 UC 类型已存在，名称冲突。</summary>
        public static readonly DiagnosticDescriptor GeneratedTypeConflict = new DiagnosticDescriptor(
            id: "UC0004",
            title: "生成类型命名冲突",
            messageFormat: "将在命名空间 '{0}' 中生成类型 '{1}'，但该类型已存在，无法覆盖。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);
        
        /// <summary>UC0005：模板结构体必须是 partial。</summary>
        public static readonly DiagnosticDescriptor MustBePartial = new DiagnosticDescriptor(
            id: "UC0005",
            title: "模板结构体必须是 partial",
            messageFormat: "结构体 '{0}' 必须标记为 partial。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);
        
        /// <summary>UC0006：所有带有 [Inherit] 的结构体必须实现 IDisposable。</summary>
        public static readonly DiagnosticDescriptor MustImplementIDisposableForAll = new DiagnosticDescriptor(
            id: "UC0006",
            title: "所有带有 [Inherit] 的结构体必须实现 IDisposable",
            messageFormat: "结构体 '{0}' 必须实现 IDisposable 接口。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);
        
        /// <summary>UC0007：基结构体必须标记 [UCBaseStruct] 或 [Inherit]。</summary>
        public static readonly DiagnosticDescriptor BaseMustBeMarked = new DiagnosticDescriptor(
            id: "UC0007",
            title: "基结构体必须标记 [UCBaseStruct] 或 [Inherit]",
            messageFormat: "基结构体 '{0}' 必须标记 [UCBaseStruct] 或 [Inherit] 特性。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);
        
        /// <summary>UC0008：带有 [UCBaseStruct] 的结构体必须实现 IDisposable。</summary>
        public static readonly DiagnosticDescriptor UCBaseStructMustImplementIDisposable = new DiagnosticDescriptor(
            id: "UC0008",
            title: "带有 [UCBaseStruct] 的结构体必须实现 IDisposable",
            messageFormat: "结构体 '{0}' 带有 [UCBaseStruct] 特性，必须实现 IDisposable 接口。",
            category: "UnmanagedClassGenerator",
            defaultSeverity: DiagnosticSeverity.Error,
            isEnabledByDefault: true);
      
    }
    
}
